﻿using DotNetCoreApi.Plugins;
using DotNetCoreApi.Plugins.Quartz;
using DotNetCoreApi.Plugins.Quartz.MyJob;
using Microsoft.AspNetCore.Mvc;
using Quartz;
using System.Threading.Tasks;

namespace DotNetCoreApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class QuartzController : ControllerBase
    {
        public QuartzHelper quartzHelper { get; set; }


        [HttpPost]
        public async Task Delay()
        {
           await quartzHelper.Delay(typeof(TestJob),"delay",10);
        }
        [HttpPost]
        public async Task Repeat()
        {
            await quartzHelper.RepeatForever(typeof(TestJob),"repeatForever",3);
        }
    }
}
